package com.example.house.adapter

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.house.R
import com.example.house.entity.Processing

class HouseStepsAdapter : BaseQuickAdapter<Processing,BaseViewHolder>(R.layout.item_steps) {
    override fun convert(holder: BaseViewHolder, item: Processing) {
        holder.setText(R.id.business,item.business)
        holder.setText(R.id.stepTime,item.stepTime)

        val circleView = holder.getView<View>(R.id.circle)
        if (item.stepTime.isEmpty() || item.stepTime == "待处理"){
            // 使用灰色圆形表示未处理
            circleView.setBackgroundResource(R.drawable.circle_background_gray)
        } else {
            // 使用绿色圆形表示已处理
            circleView.setBackgroundResource(R.drawable.circle_background)
        }
    }
}